#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
//https://www.luogu.com.cn/problem/P12132
using namespace std;

int main()
{
	int n;
	cin >> n;
	int res = n;
	for (int i = 1; i <= n; ++i)
	{
		int x;
		cin >> x;
		if (x == 1)res--;
	}
	cout << res << endl;

	return 0;
}